package chpater5;

class Args {

	int x;

	void add(int x) {
		x += 50;
	}

	void add(Args arg) {

		arg.x += 40;

	}

	void addNew(Args arg) {

		arg = new Args();

	}

	void add(int[] arr) {

		arr[0]++;

	}
}

public class ArgsTest {

	public static void main(String[] args) {

		Args arg = new Args();

		arg.x = 100;
		
		int[] arr = new int[1];

		arg.add(arg.x);
		System.out.println("arg.x = " + arg.x);
		
		arg.add(arg);
		System.out.println("arg.x = " + arg.x);
		
		arg.addNew(arg);
		System.out.println("arg.x = " + arg.x);
		
		arg.add(arr);
		System.out.println("arg[0] = " + arr[0]);

	}

}

class b {
}

class c {
}

class d {
}

class e {
}